package pkmn;

import java.util.Random;

public enum Genre {
    male{
        @Override
        public String toString(){
            return "♂";
        }
    },
    female{
        @Override
        public String toString(){
            return "♀";
        }
    },
    none{
        @Override
        public String toString(){
            return "";
        }
    };

    /**
     * Return a Genre. If the parameter is null, return a random Genre.
     * @param genre String (options: "male", "female", "none", null)
     * @return Genre
     */
    public static Genre generate(String genre){  
        if (genre.equals("male")) return Genre.male;
        else if(genre.equals("female")) return Genre.female;
        else if(genre.equals("none")) return Genre.none;
        else{
            Genre[] list = {Genre.male, Genre.female};
            return list[new Random().nextInt(2)];
        }
    }

    public static Genre generate(){
        return generate(null);
    }
}
